<template>
      <td v-if="_type=='td'" :class="{'single line':(col.rs&&col.rs.length<50)||col.btns}"  v-show="isShow">
        <mycell :col="col" :ctl="ctl"></mycell>
      </td>

      <th v-else :class="head.field" v-show="isShow">
        {{head.title}} <i class="ui icon remove" :_key="_key" title="隐藏该列" @click="hideColumn(`${head.field}_${head.title}`)"></i>
      </th>
</template>
<script type="text/ecmascript-6">
import tool from 'src/util/tool';
import util from '_util/index';

import mycell from 'components/page/cell'


export default {
  data() {
    return {
    }
  },
  computed: {
    _key(_key){
      return `${this._col.field}_${this._col.title}`;
    },
    _col(){
      return this._type=='td'?this.col:this.head;
    },
    isShow(){
      if(this.changeHideCol||this.useHideConf) {
        return !this.columnShow[this._key];
      }else{
          let obj= this._type=='td'?this.col:this.head;
        return obj.flag != 'HIDE';
      }
//        !columnShow[_key]||(!columnShow[_key]&&col.flag!='HIDE')
    },
  },
  watch: {
  },
  created() {
  },
  methods: {
    hideColumn(key){
      this.$emit('hideColumn', key);
    },
    setEnum(name, val) {
      this.showFields= val;
    },
  },
  components: {mycell},
  props: ['col','ctl','head','_type','changeHideCol','useHideConf']
}
</script>
<style rel="stylesheet/less"  lang="less">@dir: "common/";

.fenye-wrapper {
}
</style>
